package com.maven;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * AOP实现的第一种方法proxy,invocationHader
 */

@Component
@Aspect
public class Student {

    @Pointcut("execution(* com.maven.DemoService.test(String))")
    public void point(){}
/*

    @After("point()")
    public void After(JoinPoint joinPoint){
        System.out.println(joinPoint.getArgs().length);
        System.out.println("年后");
    }

    @Before("point()")
    public void befor() {

        System.out.println("年前");
    }
*/

    @Around("point()")
    public void Aroud(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        proceedingJoinPoint.proceed();
        System.out.println("环绕通知");
    }





}
